package com.alibaba.dubbo.remoting.msgcodec;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import com.alibaba.dubbo.remoting.MessageEncode;
import com.alibaba.dubbo.remoting.MessageEncodeRegistry;

public class DES3Encode extends DES3CodecBase implements MessageEncode {
	 

	public DES3Encode(){
		super();
	}

	@Override
	public int encode(InputStream in, OutputStream out/*,  MessageEncodeRegistry registry*/) throws IOException {
		try {
			int ret = encrypt(in, out, this.getKey(), this.getIv());
			//registry.appendEncode("des3");
			return ret;
		} catch (Exception e) {
			throw new IOException(e);
		}
	}
}
